package tv.youxing.android.ui;

import android.app.Activity;
import android.os.Bundle;
import android.widget.GridView;

import com.kymjs.rxvolley.RxVolley;
import com.kymjs.rxvolley.client.HttpCallback;
import com.kymjs.rxvolley.client.HttpParams;

import java.util.ArrayList;
import java.util.List;

import butterknife.BindView;
import butterknife.ButterKnife;
import tv.youxing.android.R;
import tv.youxing.android.entity.HomeModuleMoreModel;
import tv.youxing.android.utils.GsonUtils;
import tv.youxing.android.utils.StaticClass;


public class MoreHotActivity extends Activity {


    @BindView(R.id.rv)
    GridView mGridView;
    private HomeModuleMoreModel allData;
    private List<HomeModuleMoreModel.ResultBean.DataBean> listDatas = new ArrayList<>();

    int module_id;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_more_hot);
        ButterKnife.bind(this);

        module_id = Integer.parseInt(getIntent().getStringExtra("module_id"));

        loadData(module_id);
    }


    void loadData(int module_id){

        HttpParams params = new HttpParams();
        params.put("module_id",module_id);


        RxVolley.post(StaticClass.home_module_more, params, new HttpCallback() {
            @Override
            public void onSuccess(String t) {
                allData = GsonUtils.GsonToBean(t,HomeModuleMoreModel.class);
//                listDatas = allData.getResult().getData();
//                mGridView.setAdapter(new VideoAdapter(MoreHotActivity.this, listDatas));
//                mGridView.setOnItemClickListener(new AdapterView.OnItemClickListener() {
//                    @Override
//                    public void onItemClick(AdapterView<?> adapterView, View view, int i, long l) {
//                        Intent intent = new Intent(MoreHotActivity.this, SubscribeDeteilsActivity.class);
//                        intent.putExtra("multimedia_id",listDatas.get(i).getMultimedia_id()+"");
//                        startActivity(intent);
//                    }
//                });
            }
        });

    }
}
